/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.swta;

import org.apache.wicket.model.LoadableDetachableModel;

/**
 *
 * @author JKorreck
 */
public class DetacheableCategoryModel extends LoadableDetachableModel {

    Integer id;

    public DetacheableCategoryModel(Category cat) {
        this(cat.getId());
    }

    public DetacheableCategoryModel(Integer id) {
        this.id = id;
    }

    @Override
    protected Object load() {
        return CategoryManager.getInstance().getCategory(id);
    }

}
